package routers

import (
	"github.com/astaxie/beego"
	"lazyops_go/itemControllers"
)

func init() {

	//找到路由后执行controller 之前
	beego.InsertFilter("/item/*", beego.BeforeExec, PermsFilter)
	
	//项目
	beego.Router("/item/prj/", &itemControllers.ItemController{}, "get:IndexPrj")
	beego.Router("/item/addprj/",&itemControllers.ItemController{},"post:CreatePrj")
	beego.Router("/item/idprj/",&itemControllers.ItemController{},"post:GetIdPrj")
	beego.Router("/item/editprj/",&itemControllers.ItemController{},"put:EditPrj")
	beego.Router("/item/delprj/",&itemControllers.ItemController{},"post:DelPrj")
	beego.Router("/item/searchprj/:key/",&itemControllers.ItemController{},"get:SearchPrj")


	//平台
	beego.Router("/item/platfm/", &itemControllers.ItemController{}, "get:IndexPlatfm")
	beego.Router("/item/addplatfm/",&itemControllers.ItemController{},"post:CreatePlatfm")
	beego.Router("/item/idplatfm/",&itemControllers.ItemController{},"post:GetIdPlatfm")
	beego.Router("/item/editplatfm/",&itemControllers.ItemController{},"put:EditPlatfm")
	beego.Router("/item/delplatfm/",&itemControllers.ItemController{},"post:DelPlatfm")
	beego.Router("/item/searchplatfm/:key/",&itemControllers.ItemController{},"get:SearchPlatfm")

	//发布
	beego.Router("/item/release/", &itemControllers.ItemController{}, "get:IndexRelease")
	beego.Router("/item/addrelease/",&itemControllers.ItemController{},"post:CreateRelease")
	beego.Router("/item/idrelease/",&itemControllers.ItemController{},"post:GetIdRelease")
	beego.Router("/item/editrelease/",&itemControllers.ItemController{},"put:EditRelease")
	beego.Router("/item/delrelease/",&itemControllers.ItemController{},"post:DelRelease")
	beego.Router("/item/searchrelease/:key/",&itemControllers.ItemController{},"get:SearchRelease")
	beego.Router("/item/syncvs/",&itemControllers.ItemController{},"post:SyncVersion")
	beego.Router("/item/coderelease/",&itemControllers.ItemController{},"post:CodeRelease")
	beego.Router("/api/syncvs/:prj/:branch/",&itemControllers.ItemController{},"get:ApiSyncVs")
	beego.Router("/item/codehotup/",&itemControllers.ItemController{},"post:CodeHotUp")


	//分支
	beego.Router("/item/branch/", &itemControllers.ItemController{}, "get:IndexBranch")
	beego.Router("/item/branch/:page/", &itemControllers.ItemController{}, "get:IndexBranch")
	beego.Router("/item/addbranch/",&itemControllers.ItemController{},"post:CreateBranch")
	beego.Router("/item/editbranch/",&itemControllers.ItemController{},"get:GetBranchEditInfo")
	beego.Router("/item/editbranch/",&itemControllers.ItemController{},"put:EditBranch")
	beego.Router("/item/delbranch/",&itemControllers.ItemController{},"post:DelBranch")
	beego.Router("/item/searchbranch/:key/",&itemControllers.ItemController{},"get:SearchBranch")
	beego.Router("/item/testupdate/",&itemControllers.ItemController{},"post:TestServerUp")
}
